package com.taotao.complier.calcu.ast;

import com.taotao.complier.calcu.visit.Visitor;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public class Term2Node implements AstNode {
    // term2 ->  MUL_DIV factor term2 |  ε

    private MulDivNode mulDiv;
    private FactorNode factor;
    private Term2Node term2;


    @Override
    public void accept(Visitor visitor) {
        mulDiv.accept(visitor);

        if(null != factor){
            factor.accept(visitor);
        }

        if(null != term2){
            term2.accept(visitor);
        }

        visitor.visitTerm2(this);
    }
}
